# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=2
inherit eutils subversion

ALICE_INSTALL_DIR="/opt/cern/alice"

alice_set_alien_env() {
  export XROOTD_DIR="$ALICE_INSTALL_DIR/xrootd/$XROOTD_VERSION"
  if [ ! -d $XROOTD_DIR ];then
    die "XROOTD_DIR was not found or is not directory  !!!"
  fi
  export ALIEN_DIR="$ALICE_INSTALL_DIR/alien/$ALIEN_VERSION"
  if [ ! -d $ALIEN_DIR ];then
    die "ALIEN_DIR was not found or is not directory  !!!"
  fi

  export PATH="$ALIEN_DIR/bin:$PATH"
  export LD_LIBRARY_PATH="$ALIEN_DIR/lib:$LD_LIBRARY_PATH"
}


alice_set_rootsys_env() {
  export ROOTSYS="$ALICE_INSTALL_DIR/root/$ROOT_VERSION"
  if [ ! -d $ROOTSYS ];then
    die "ROOTSYS was not found or is not directory !!!"
  fi
  export PATH="$ROOTSYS/bin:$PATH"
  export LD_LIBRARY_PATH="$ROOTSYS/lib:$LD_LIBRARY_PATH"
}

alice_set_geant3_env() {
  export GEANT3="$ALICE_INSTALL_DIR/geant3/$GEANT3_VERSION"
  if [ ! -d $GEANT3 ];then
    die "GEANT3 was not found or is not directory !!!"
  fi
  if [ ! -d $ROOTSYS ];then
    die "ROOTSYS was not found or is not directory !!!"
  fi
  export G3ARCH=`root-config --arch`
  export LD_LIBRARY_PATH="$GEANT3/lib/tgt_$G3ARCH/:$LD_LIBRARY_PATH"
}
